import request from '@/utils/request.js'

// 获取列表
export const getcommunityListApi = (params)=>{
    return request({
        url:'/parking/index',
        method:'get',
        params
    })
}

// 获得小区名称
export const getcommunityNameApi = ()=>{
    return request({
        url:'/community',
        method:'get',
      
    })
}

// 获取详情
export const getcommunityInfoApi = (id)=>{
    return request({
        url:'/parking/index/'+id,
        method:'get',
    })
}

// 新增数据
export const addcommunityApi = (data)=>{
    return request({
        url:'/parking/index',
        method:'post',
        data
    })
}

// 修改数据
export const editcommunityyApi = (data)=>{
    return request({
        url:'/parking/index/'+data.id,
        method:'put',
        data
    })
}

// 删除
export const delcommunityApi = (id)=>{
    return request({
        url:'/parking/index/'+id,
        method:'delete'
    })
}

//获取车位名称
export const getparkingNameApi = (community_code)=>{
    return request({
        url:'/parking/index',
        method:'get',
        community_code
      
    })
}